package top.lixunda.commerce.common.core.controller.wrapper;

import java.io.Serializable;

/**
 * @author LiXunda
 * @version time:2019/10/14 9:35
 */
@SuppressWarnings("WeakerAccess")
public class UpdateEntityBlock<T> extends EntityBlock<T> implements IUpdateEntityBlock, Serializable {

    public UpdateEntityBlock() {
        //默认更新所有
        this.setType(EntityBlock.TYPE_ALL);
    }

    @Override
    public IUpdateEntityBlock set(String column, Object value) {
        this.setType(EntityBlock.TYPE_CHOICE);
        this.getColumns().put(column, String.valueOf(value));
        return this;
    }

    @Override
    public IUpdateEntityBlock updateAll() {
        this.setType(EntityBlock.TYPE_ALL);
        return this;
    }

    @Override
    public IUpdateEntityBlock updateNotNull() {
        this.setType(EntityBlock.TYPE_NOT_NULL);
        return this;
    }
}
